package Javashiyan8;
import java.util.Scanner;
public class program10_1 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);

        System.out.print("Enter annual interest rate,for example, 8.25: ");

        double annualInterestRate = input.nextDouble();

        System.out.print("Enter number of years as an integer: ");

        int numberOfYears = input.nextInt();

        System.out.print("Enter loan amount, for example, 120000.95: ");

        double loanAmount = input.nextDouble();

        Loan loan = new Loan(annualInterestRate,numberOfYears,loanAmount);

        System.out.printf("""
                The loan was created on %s
                The monthly payment is %.2f
                The total payment is %.2f
                """, loan.getLoanDate().toString(),loan.getMonthlyPayment(),loan.getTotalPayment());
    }
}
